
from django.urls import path
from .views import *

urlpatterns = [

    # 发送短信验证码
    path('smscode/', SendCode.as_view({'post':'smscode'})),

    # 顾客注册
    path('register/', UserView.as_view({'post':'register'})),

    # 顾客或者商家登录
    path('login/', UserView.as_view({'post':'login'})),

    # 商品类别
    path('goods_type/<int:pk>', GoodTypeView.as_view({"get": "list"})),

    # 商品详情
    path('goods/<int:pk>', GoodsView.as_view({"get":"good_get"})),

    # 用户信息管理
    path('userinfo/', UserView.as_view({'get':'userinfo','put':'update_info'})),

    # 用户地址管理
    path('address/',AddressView.as_view({'get': 'addressList', 'post': 'add', 'put': 'update', 'delete': 'delete'})),

    # 购物车
    path('shopping/', ShoppingView.as_view({"post": "shoppinglist", "get": "shopping_get"})),

    # 上传
    path('upyou/', UpyouImgView.as_view({"post": "post"})),

    # 收藏
    path('collect/', CollectView.as_view({"post": "collect_post", "get": "collect_get"})),

    path('collect/<int:pk>', CollectView.as_view({"delete": "collect_del"})),

    # 评论
    path('comment/', CommentView.as_view({"post": "Comment_post"})),

    # 获取商家的所有评论
    path('comment/<int:pk>', CommentView.as_view({"get": "comment_list"})),

    # 订单和判断订单是否支付成功路由
    path('order/', OrderView.as_view({"post": "order_post", "get": "check_order"})),

    # 获取没有支付的订单的地址  删除订单
    path('not_order/<int:pk>', OrderView.as_view({"post": "not_order_get", "delete": "order_del"})),

    # 获取用户所有订单
    path('order_list/', OrderView.as_view({"get": "order_get"})),

    # 获取订单的详情和取消支付订单
    path('order_details/<int:pk>', OrderView.as_view({"get": "order_get_details", "delete": "not_order_del"})),

    # 获取没有支付的订单
    path('ordernot/', OrderView.as_view({"get": "order_list"})),

    # 获取支付的订单
    path('order_pay/', OrderView.as_view({"get": "order_pay"})),
]
